<template>
  <div>
    <div class="block-header">
      <h2>商品管理</h2>
      <div class="block-header-btn">
        <el-button type="primary" size="small" @click="handleAdd">新增商品</el-button>
      </div>
    </div>
    <div class="block-container">
      <el-table :data="goodsList" border style="width: 100%">
        <el-table-column prop="id" label="商品ID" width="100"></el-table-column>
        <el-table-column prop="name" label="商品名称" width="200"></el-table-column>
        <el-table-column prop="price" label="商品价格" width="150"></el-table-column>
        <el-table-column label="操作" width="150">
          <template slot-scope="scope">
            <el-button type="text" size="mini" @click="handleEdit(scope.$index)">编辑</el-button>
            <el-button type="text" size="mini" @click="handleDelete(scope.$index)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

